<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>选择服务方式</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="service-add">
    <div class="title bottom-border">选择服务点</div>
    <div id="addlist" class="content">
        <!--/mobile/address/getService addressId -->
        <!--<div class="add-item bottom-border on">-->
        <!--<div class="text">-->
        <!--<div class="name-tel">恋痕<i class="tel">15112343500</i></div>-->
        <!--<div class="addr">浙江省杭州市萧山区宁围镇国泰科技大厦22楼浙江省杭州市萧山区宁围镇国泰科技大厦22楼</div>-->
        <!--<div class="dingwei">-->
        <!--<div class="distance">6.1km</div>-->
        <!--<div class="des">离我最近</div>-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="radio"></div>-->
        <!--</div>-->

    </div>
</div>
<!-- 选择服务点 -->

<div class="order-menu-section">
    <div class="order-menu bottom-border">
        <div class="text">
            <div class="checkbox-wrapper">
                <!--<div class="checkbox"></div>-->
                <!--<div class="title">自提</div>	-->
            </div>
        </div>
        <a href="javascript:;" class="button">确定</a>
    </div>
    <div class="zhanwei"></div>
</div>
<!-- 底部菜单 -->


<!-- 以下为页面js部分 -->

<script type="text/javascript" src="js/rem.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>

<script src="js/pages/public.js" type="text/javascript" charset="utf-8"></script>

<script>


    var addressId = getUrlParam("addressId");

    $.ajax({
        type: "post",
        url: ajaxUrl + "/mobile/address/getService",
        async: true,
        data: {'addressId': addressId},
        success: function (data) {
            console.log(data.result);
            var result = data.result;

            var a = "";
            for (i = 0; i < result.length; i++) {
                if (i==0) {
                    a += '<div onclick="history.go(-1)" class="add-item bottom-border on">' +
                        '				<div class="text">' +
                        '					<div class="name-tel">' + result[i].name + '<i class="tel">' + result[i].mobile + '</i></div>' +
                        '					<div class="addr">' + result[i].address + '</div>' +
                        '					<div class="dingwei">' +
                        '						<div class="distance">' + result[i].distance + 'km</div>' +
                        '						<div class="des">离我最近</div>' +
                        '					</div>' +
                        '				</div>' +
                        '				<div class="radio on"></div>' +
                        '			</div>';
                }else {
                    a += '<div onclick="history.go(-1)" class="add-item bottom-border on">' +
                        '				<div class="text">' +
                        '					<div class="name-tel">' + result[i].name + '<i class="tel">' + result[i].mobile + '</i></div>' +
                        '					<div class="addr">' + result[i].address + '</div>' +
                        '					<div class="dingwei">' +
                        '						<div class="distance">' + result[i].distance + 'km</div>' +
                        '						<div class="des">离我最近</div>' +
                        '					</div>' +
                        '				</div>' +
                        '				<div class=""></div>' +
                        '			</div>';
                }
            }
            $('#addlist').html(a);
        }

        });


    $('.service-add .add-item').click(function () {
        $(this).addClass('on').siblings().removeClass('on');
    })
    // 选择服务点

    $('.checkbox-wrapper').click(function () {
        if ($(this).hasClass('on')) {
            $(this).removeClass('on');
        } else {
            $(this).addClass('on');
        }
    })
    // 是否自提
</script>
</body>
</html>